# -*- encoding:utf-8 -*-
# @Time: 2022/11/9 10:26
# @Author :xibin
# @Email: xibin@maqu. com
# @File: urls.py
# @Software: PyCharm

from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token
from .views import ImageVerifyView, UserViewSet, AreaViewSet, AddressViewSet
from rest_framework.routers import DefaultRouter  #默认路由，路由器的创建

urlpatterns = [
    path('login/',obtain_jwt_token), #token登陆
    path('image/verification/<uuid:uuid>/',ImageVerifyView.as_view())

]
router = DefaultRouter()  #创建路由器
router.register('user',UserViewSet)  #注册
router.register('area',AreaViewSet)  #注册
router.register('address',AddressViewSet,basename='address')  #basename是在视图集没写queryset时需要添加的，当然也可以在视图集里加上queryset，但是没有意义，会被get_queryset取代
urlpatterns +=router.urls  #拼接路由


